@ECHO OFF
ECHO.*** Unregistering and deleting assemblies ***
set CompanyName=evorgevol
set AssemblyName=MBWebService.Client
set RegistrationName=Registration
set BasePath=D:\Projects\mediabrowser-rc\MBWebService\%AssemblyName%
 
ECHO.Determine whether we are on an 32 or 64 bit machine
ECHO.if "%PROCESSOR_ARCHITECTURE%"=="x86" if "%PROCESSOR_ARCHITEW6432%"=="" goto x86
set ProgramFilesPath=%ProgramFiles(x86)%

ECHO.Unregister and delete previously installed files (which may fail if nothing is registered)

ECHO.Unregister the application entry points
%windir%\ehome\RegisterMCEApp.exe /allusers "%ProgramFilesPath%\%CompanyName%\%AssemblyName%\%RegistrationName%.xml" /u

ECHO.Remove the DLL from the Global Assembly cache "%AssemblyName%"
"%ProgramFilesPath%\Microsoft SDKs\Windows\v7.0A\bin\gacutil.exe" /u "%AssemblyName%"
"%ProgramFilesPath%\Microsoft SDKs\Windows\v7.0A\bin\gacutil.exe" /u "MBWebService.Core"
	
ECHO.Delete the folder containing the DLLs and supporting files (silent if successful)
rd /s /q "%ProgramFilesPath%\%CompanyName%\%AssemblyName%"
ECHO.End of delete